<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>图片新闻管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			//$("#name").focus();
			$("#inputForm").validate({
				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
		});
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li><a href="${ctx}/cms/exImage/?category.id=${exImage.category.id}">图片新闻列表</a></li>
		<li class="active"><a href="${ctx}/cms/exImage/form?category.id=${exImage.category.id}">图片新闻<shiro:hasPermission name="cms:exImage:edit">${not empty exImage.id?'修改':'添加'}</shiro:hasPermission><shiro:lacksPermission name="cms:exImage:edit">查看</shiro:lacksPermission></a></li>
	</ul><br/>
	<form:form id="inputForm" modelAttribute="exImage" action="${ctx}/cms/exImage/save" method="post" class="form-horizontal">
		<form:hidden path="id"/>
		<sys:message content="${message}"/>		
		<div class="control-group">
			<label class="control-label">栏目名称：</label>
			<div class="controls">
                <sys:treeselect id="category" name="category.id" value="${exImage.category.id}" labelName="category.name" labelValue="${exImage.category.name}"
                                title="栏目" url="/cms/category/treeData" module="exImage" selectScopeModule="true" notAllowSelectRoot="false" notAllowSelectParent="true" cssClass="required"/>&nbsp;
				<%--<form:input path="category.id" labelName="category.name" lableValue="${exImage.category.name}"  htmlEscape="false" maxlength="64" class="input-xlarge required" disabled="true"/>--%>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">图片名称：</label>
			<div class="controls">
				<form:input path="title" htmlEscape="false" maxlength="255" class="input-xlarge required"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">标题颜色：</label>
			<div class="controls">
				<form:input path="color" htmlEscape="false" maxlength="50" class="input-xlarge "/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">链接图片：</label>
			<div class="controls">
				<form:hidden id="image" path="image" htmlEscape="false" maxlength="255" class="input-xlarge"/>
				<sys:ckfinder input="image" type="images" uploadPath="/cms/exImage" selectMultiple="false"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group" style="display:none">
			<label class="control-label">链接地址：</label>
			<div class="controls">
				<form:input path="href" htmlEscape="false" maxlength="255" class="input-xlarge "/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">权重：</label>
			<div class="controls">
				<form:input path="weight" htmlEscape="false" maxlength="200" class="input-mini required digits"/>&nbsp;
				<%--<form:input path="weight" htmlEscape="false" maxlength="11" class="input-xlarge digits"/>--%>
                <span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<%--<div class="control-group">--%>
			<%--<label class="control-label">权重期限：</label>--%>
			<%--<div class="controls">--%>
				<%--<input name="weightDate" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate "--%>
					<%--value="<fmt:formatDate value="${exImage.weightDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"--%>
					<%--onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/>--%>
			<%--</div>--%>
		<%--</div>--%>
		<div class="control-group">
			<label class="control-label">备注信息：</label>
			<div class="controls">
				<form:textarea path="remarks" htmlEscape="false" rows="4" maxlength="255" class="input-xxlarge"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">新闻内容：</label>
			<div class="controls">
				<form:input path="content" htmlEscape="false" maxlength="255" class="input-xlarge required"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">图集：</label>
			<div class="controls">
				<form:hidden id="images" path="images" htmlEscape="false" maxlength="255" class="input-xlarge"/>
				<sys:ckfinder input="images" type="images" uploadPath="/cms/exImage" selectMultiple="true"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
        <shiro:hasPermission name="cms:article:audit">
            <div class="control-group">
                <label class="control-label">发布状态:</label>
                <div class="controls">
                    <form:radiobuttons path="delFlag" items="${fns:getDictList('cms_del_flag')}" itemLabel="label" itemValue="value" htmlEscape="false" class="required"/>
                    <span class="help-inline"></span>
                </div>
            </div>
        </shiro:hasPermission>
		<div class="form-actions">
			<shiro:hasPermission name="cms:exImage:edit"><input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;</shiro:hasPermission>
			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
		</div>
	</form:form>
</body>
</html>